package com.polymorphismodeldemo;

/**
 * @Auther: shiquan
 * @Date: 2024/10/21 - 10 - 21 -11:34
 */
public class Test {
    public static void main(String[] args) {
        Student stu = new Student();
        stu.setAge(18);
        stu.setName("张三");


        Teacher tea = new Teacher();
        tea.setAge(32);
        tea.setName("李四");

        Administrator adm = new Administrator();
        adm.setAge(50);
        adm.setName("王五");

        register(stu);
        register(tea);
        register(adm);
    }
    //这个方法可以接受学生 老师 管理员
    public static void register(Person p){
        p.show();


    }
}
